package sys.cloud.escape;

import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

/**
 * // 用这个类替换ServletOutputStream
 * Created by shiyusen on 2017/3/23.
 */
public class ByteArrayServletOutputStream  extends ServletOutputStream {
    ByteArrayOutputStream baos;
    public void write(int b) throws IOException {

        baos.write(b);
    }
    public ByteArrayServletOutputStream(ByteArrayOutputStream baos) {
        this.baos = baos;
    }

    @Override
    public boolean isReady() {
        return false;
    }

    @Override
    public void setWriteListener(WriteListener writeListener) {

    }
}
